//
//  MyButtonView.m
//  MHMusic
//
//  Created by 马欢 on 16/1/11.
//  Copyright © 2016年 蓝鸥. All rights reserved.
//

#import "MyButtonView.h"

@implementation MyButtonView

-(void)myTarget:(id)target action:(SEL)action
{
    _target = target;
    _action = action;
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    if ([_target respondsToSelector:_action]) {
        //        检测是否有这个方法，如果有就执行这个方法，如果没有
        [_target performSelector:_action withObject:self];
    }
}
@end
